package com.tengju.support.domain.model.wx;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum AttrType {

    TEXT(0, "文本"),
    WEB(1, "网页"),
    APPLETS(2, "小程序"),
    ;

    private Integer val;
    private String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }


    public static AttrType fromVal(Integer val) {
        if (val == null) {
            return null;
        }
        for (AttrType type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }
}
